Skip to content

Conversation

@wgtmac
Copy link
Member

@wgtmac wgtmac commented Apr 18, 2025

@wgtmac wgtmac force-pushed the add_metadata_json_test branch 3 times, most recently from 0bd62f2 to 098e848 Compare April 18, 2025 15:48
@wgtmac wgtmac force-pushed the add_metadata_json_test branch from 098e848 to 9c096d6 Compare April 19, 2025 05:10
Copy link
Collaborator

@zhjwpku zhjwpku left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

}

const std::shared_ptr<Schema>& TableMetadata::Schema() const {
static const std::shared_ptr<::iceberg::Schema> empty_schema = nullptr;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not return a truly empty schema object, but null?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I once had the same concern, but this method returns a reference, I guess that's the reason?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I switched to wrap the return in a Result so we can get an explicit NotFound error.

Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great @wgtmac, thanks for adding these test-cases 👍

rev: v19.1.5
hooks:
- id: clang-format
exclude: ^test/resources/.*\.json$
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does clang want to format json? 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, without this change the pre-commit fails and complains that clang-format does not support JSON file.

Copy link
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The community has reached a consensus. Let's move forward!

@Xuanwo Xuanwo merged commit 2aed97b into apache:main Apr 21, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants